
// Copyright (C) Recursion Company. All rights reserved.

#ifndef __VOL_DP1_H__
#define __VOL_DP1_H__

#include "vol_md5.h"

CVolMem& VolRunEncrypt (const BYTE* pbData, INT nDataSize, const TCHAR* szPassword, BOOL blIsEncrypt, INT nMode, CVolMem& memResult);
inline_ CVolMem& VolRunEncrypt (const CVolMem& memData, const TCHAR* szPassword, BOOL blIsEncrypt, INT nMode, CVolMem& memResult)
{
    return VolRunEncrypt (memData.GetPtr (), (INT)memData.GetSize (), szPassword, blIsEncrypt, nMode, memResult);
}

CVolMem& VolCompress (const BYTE* pbData, INT nDataSize, CVolMem& memResult);
CVolMem& VolUncompress (const BYTE* pbData, INT nDataSize, CVolMem& memResult);
inline_ CVolMem& VolCompress (const CVolMem& memData, CVolMem& memResult)
{
    return VolCompress (memData.GetPtr (), (INT)memData.GetSize (), memResult);
}
inline_ CVolMem& VolUncompress (const CVolMem& memData, CVolMem& memResult)
{
    return VolUncompress (memData.GetPtr (), (INT)memData.GetSize (), memResult);
}

CVolString& VolGetMD5 (const BYTE* pBuf, INT nLength, CVolString& strOut);
inline_ CVolString& VolGetMD5 (const CVolMem& memData, CVolString& strOut)
{
    return VolGetMD5 (memData.GetPtr (), (INT)memData.GetSize (), strOut);
}

CVolString& VolRSAEncrypt (const BYTE* pbData, INT nDataSize, const TCHAR* szRSAPrivateKey, const TCHAR* szRSAModule, CVolString& strResult);
BOOL VolRSACheck (const BYTE* pbData, INT nDataSize, const TCHAR* szRsaEncryptResult, const TCHAR* szRSAPublicKey, const TCHAR* szRSAModule);
inline_ CVolString& VolRSAEncrypt (const CVolMem& memData, const TCHAR* szRSAPrivateKey, const TCHAR* szRSAModule, CVolString& strResult)
{
    return VolRSAEncrypt (memData.GetPtr (), (INT)memData.GetSize (), szRSAPrivateKey, szRSAModule, strResult);
}
inline_ BOOL VolRSACheck (const CVolMem& memData, const TCHAR* szRsaEncryptResult, const TCHAR* szRSAPublicKey, const TCHAR* szRSAModule)
{
    return VolRSACheck (memData.GetPtr (), (INT)memData.GetSize (), szRsaEncryptResult, szRSAPublicKey, szRSAModule);
}

#endif
